feat(crypto/grsa): Add RSA encryption and decryption function#4571
Merged
hailaz merged 13 commits intogogf:masterfrom Dec 26, 2025
Merged
feat(crypto/grsa): Add RSA encryption and decryption function#4571hailaz merged 13 commits intogogf:masterfrom
hailaz merged 13 commits intogogf:masterfrom
Conversation
hailaz
approved these changes
Dec 25, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a comprehensive RSA encryption/decryption package to the GoFrame framework, providing support for both PKCS#1 and PKCS#8 key formats with base64 encoding capabilities.
- Implements RSA key pair generation in both PKCS#1 and PKCS#8 formats
- Provides encryption/decryption functions with format auto-detection and format-specific variants
- Includes comprehensive test suite and detailed documentation with usage examples
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| crypto/grsa/grsa.go | Core implementation with 377 lines including key generation, encryption/decryption functions for both PKCS formats, and utility functions |
| crypto/grsa/grsa_z_unit_test.go | Test suite covering key generation, encryption/decryption, format detection, and base64 operations |
| crypto/grsa/README.md | Comprehensive package documentation with feature overview, usage examples, and API reference |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
补充RSA加密解密功能
This pull request improves documentation and developer onboarding for the project, with a particular focus on the RSA cryptography package and general installation instructions. The main changes include the addition of a comprehensive README for the
grsaRSA package, updated installation steps in both English and Chinese documentation, and minor clarifications to documentation links.Documentation improvements:
README.mdfor thecrypto/grsapackage, including features, security considerations, usage examples, API descriptions, key format explanations, and error handling guidance.README.MD) and Chinese (README.zh_CN.MD) documentation to include a clear installation section withgo getinstructions for easier onboarding. [1] [2]Developer tooling:
go installcommand forgolangci-lintin theMakefileto assist developers in setting up linting tools.